<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->get('/notification', 'Admin\\NotificationController@index');
    $router->get('/notification/{id}', 'Admin\\NotificationController@read');

    #配置管理
    $router->group(["prefix"=>"config"],function (Router $router){
        $router->get("/app","Config\\AppController@index");#网站配置
        $router->get("/site","Config\\SiteController@index");#数据配置
        //$router->get("/wechat","Config\\WechatController@index");#微信配置
        //$router->get("/payment","Config\\PaymentController@index");#支付配置
        $router->resource("dict","Config\\DictController")->except(["show"]);#字典管理
        $router->resource("dict-datum","Config\\DictDatumController")->except(["show"]);#字典值管理
    });

    #用户管理
    $router->resource("user","User\\UserController");
    $router->get("user/{id}/log/{type}","User\\LogController@types");//登录日志

    #文章管理
    $router->get("article/match","Content\\ArticleController@match");#模糊匹配
    $router->resource("article","Content\\ArticleController")->except(["show"]);
    #文章分类
    $router->resource("article-category","Content\\ArticleCategoryController")->except(["show"]);
});
